package org.groovymud.object;

public class ObjectLocation {

	String definition = "";
	String handle = "";

	public ObjectLocation() {
	}

	public ObjectLocation(ObjectLocation objectLocation) {
		if (objectLocation == null) {
			throw new IllegalArgumentException("objectLocation cannot be null");
		}
		this.definition = objectLocation.definition;
		this.handle = objectLocation.handle;
	}

	public String getDefinition() {
		return definition;
	}

	public void setDefinition(String definitionScriptLocation) {
		this.definition = definitionScriptLocation;
	}

	public String getHandle() {
		return handle;
	}

	public void setHandle(String handle) {
		this.handle = handle;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof ObjectLocation)) {
			return false;
		}
		ObjectLocation other = (ObjectLocation) obj;
		return definition.equals(other.definition) && handle.equals(other.handle);
	}

	@Override
	public int hashCode() {
		return super.hashCode() + definition.hashCode() + handle.hashCode();
	}
}
